package com.da.springtest.ioc.parent;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author chenlida
 * @date 2020/6/13 21:52
 * @description
 */
public class TestMethod {
    public static void main(String[] args) {
        System.out.println("spring容器启动中...");
        //1.bean配置文件位置
        String beanXml = "classpath:bean/beanParent.xml";
        //2.创建ClassPathXmlApplicationContext容器，给容器指定需要加载的bean配置文件
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(beanXml);
        System.out.println("ServiceB:" + context.getBean(ServiceB.class));
        System.out.println("ServiceC:" + context.getBean(ServiceC.class));
    }
}
